﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Collections.Generic;

namespace si.caha.Model
{
    public class Item
    {
        [Key]
        public int ItemId { get; set; }

        [StringLength(200)]
        [Required(ErrorMessage="Required!")]
        public string Title { get; set; }

        public string Description { get; set; }

        [Required]
        [RangeAttribute(0, 1000)]
        public double Price { get; set; }

        [Required]
        public DateTime DateAdded { get; set; }

        public int CategoryId { get; set; }
        public virtual Category Category { get; set; }

        public virtual ICollection<Image> Images { get; set; }
        public virtual ICollection<Review> Reviews { get; set; }
    }
}